package com.suke.czx.modules.customer.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.suke.czx.common.validate.CustomerSaveGroup;
import com.suke.czx.common.validate.CustomerUpdateGroup;
import com.suke.czx.common.validate.EnumValue;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * 应用模块名称: 客户
 * 代码描述: 客户实体
 * copyright: AUZAR ALL RIGHTS RESERVED
 * company: AUZAR
 *
 * @author: 颜米晨
 * @date: 2021/08/31 10:03:02
 */
@Data
@ApiModel(value = "客户管理")
@EqualsAndHashCode(callSuper = true)
public class Customer extends Model<Customer> {

    @ApiModelProperty(value = "客户id")
    @TableId(value = "customer_id", type = IdType.AUTO)
    @NotNull(groups = {CustomerUpdateGroup.class}, message = "客户编码不能为空")
    public Long customerId;

    @ApiModelProperty(value = "公司名称")
    @NotBlank(groups = {CustomerSaveGroup.class, CustomerUpdateGroup.class}, message = "公司名称不能为空")
    public String companyName;

    @ApiModelProperty(value = "地址")
    public String address;

    @ApiModelProperty(value = "经营范围")
    public String businessScope;

    @ApiModelProperty(value = "联系方式")
    public String contactWay;

    @ApiModelProperty(value = "邮箱")
    public String email;

    @ApiModelProperty(value = "客户等级（1优质客户、2普通客户、3黑名单客户）")
    @EnumValue(groups = {CustomerSaveGroup.class, CustomerUpdateGroup.class}, intValues = {1, 2, 3}, message = "客户等级只能是1,2,3")
    public Integer customerGrade;

    @ApiModelProperty(value = "备注")
    public String note;

    @ApiModelProperty(value = "删除标记  0：删除   1：正常")
    public Integer del;

    @ApiModelProperty(value = "创建者id")
    public Long creator;

    @ApiModelProperty(value = "创建时间")
    public Date createTime;

    @ApiModelProperty(value = "更新者id")
    public Long updater;

    @ApiModelProperty(value = "更新时间")
    public Date updateTime;

}
